public class MyArray<T> {
    public Object[] array=new Object[3];
    public void setArray(int pos,T val){
        array[pos]=val;
    }
    public T getVal(int pos){
        return (T)array[pos];
    }
}
